import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;


public class Main {
	
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		String[] strArray = str.split(" ");
		int k = Integer.parseInt(strArray[0]);
		int l = Integer.parseInt(strArray[1]);
		int n = Integer.parseInt(strArray[2]);
		
		str = br.readLine();
		StringTokenizer sToken = new StringTokenizer(str, " ");
		int[] coinsArray = new int[n];
		//long startTime = System.currentTimeMillis();

		for(int i=0; sToken.hasMoreTokens(); i++) {
			coinsArray[i] = Integer.parseInt(sToken.nextToken());
		}
		
		int coins = getMax(coinsArray);
		boolean[] memTable = new boolean[coins + 1];
		memTable[0] = false;
		for(int i = 1; i <= coins; i++) {
			boolean b = memTable[i - 1] && (i - k >= 0 ? memTable[i - k] : true) && (i - l >= 0 ? memTable[i - l] : true);
			if(b) {
				memTable[i] = false;
			} else {
				memTable[i] = true;
			}
			
		}
		StringBuffer sb = new StringBuffer();
		for(int coin : coinsArray) {
			if(memTable[coin]){
				sb.append('A');
			} else {
				sb.append('B');
			}
		}
		System.out.println(sb.toString());
		
	}
	
	private static int getMax(int[] array) {
		int max = -1;
		for(int i : array) {
			max = Math.max(max, i);
		}
		return max;
	}
	

}
